<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			function focusFun() {
				// 获取span标签对象
				let spObj = document.getElementById("sp");
				// 往span标签体中添加内容
				spObj.innerText = "输入框获得了焦点啊...";
            }

            function blurFun() {
                // 获取span标签对象
                let spObj = document.getElementById("sp");
                // 往span标签体中添加内容
                spObj.innerText = "输入框失去了焦点呀!!!!";
            }
			// 只有输入框失去焦点后才会进行内容判断,判断本次的值与上次的值是否一致
            function changeFun() {
				alert("输入框中的值改变了...");
            }
		</script>
	</head>
	<body>
		<input type="text" onchange="changeFun()" onfocus="focusFun()" onblur="blurFun()"/><br />
		<span id="sp"></span><br />
	</body>
</html>
